package com.jwthhealth_pub.wristband.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * Created by liuzhen on 2018/1/4.
 */

public class ServiceOptReceiver extends BroadcastReceiver {

    public static final String SERVICE_OPT = "service_opt";

    private ServiceOpt serviceOpt;

    public void setOnServiceOpt(ServiceOpt onServiceOpt) {
        this.serviceOpt = onServiceOpt;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (action != null && action.equals(SERVICE_OPT))
            serviceOpt.onOptStop();
    }

    public interface ServiceOpt {
        void onOptStop();
    }
}
